package com.yc.cloud.api.constants;

/**
 * 系统配置常量
 *
 * @author kinggu
 * @since 2025-09-16
 */
public class SystemConfigConstants {

    // ==================== 字典类型 ====================
    
    /**
     * 字典类型
     */
    public static final String DICT_TYPE_VIDEO_CONFIG = "VIDEO_CONFIG";
    public static final String DICT_TYPE_STORAGE_CONFIG = "STORAGE_CONFIG";
    public static final String DICT_TYPE_SYSTEM_CONFIG = "SYSTEM_CONFIG";
    public static final String DICT_TYPE_ALARM_CONFIG = "ALARM_CONFIG";
    public static final String DICT_TYPE_RECORDING_CONFIG = "RECORDING_CONFIG";

    // ==================== 系统配置键 ====================
    
    /**
     * 视频配置键
     */
    public static final String VIDEO_RECORD_DURATION = "VIDEO_CONFIG.record_duration";
    public static final String VIDEO_MAX_FILE_SIZE = "VIDEO_CONFIG.max_file_size";
    public static final String VIDEO_QUALITY_DEFAULT = "VIDEO_CONFIG.quality_default";

    /**
     * 存储配置键
     */
    public static final String STORAGE_AUTO_DELETE_DAYS = "STORAGE_CONFIG.auto_delete_days";
    public static final String STORAGE_THRESHOLD_PERCENT = "STORAGE_CONFIG.threshold_percent";
    public static final String STORAGE_PATH_ROOT = "STORAGE_CONFIG.path_root";

    /**
     * 系统配置键
     */
    public static final String SYSTEM_NAME = "SYSTEM_CONFIG.system_name";
    public static final String SYSTEM_VERSION = "SYSTEM_CONFIG.system_version";
    public static final String SYSTEM_MAX_CONCURRENT_STREAMS = "SYSTEM_CONFIG.max_concurrent_streams";

    /**
     * 告警配置键
     */
    public static final String ALARM_STORAGE_WARNING_ENABLED = "ALARM_CONFIG.storage_warning_enabled";
    public static final String ALARM_EMAIL_NOTIFICATIONS = "ALARM_CONFIG.email_notifications";
    public static final String ALARM_SMS_NOTIFICATIONS = "ALARM_CONFIG.sms_notifications";

    /**
     * 录制配置键（业务逻辑相关）
     */
    public static final String CONFIG_RECORDING_ENABLED = "RECORDING_CONFIG.enabled";
    public static final String CONFIG_MAX_RETRY_TIMES = "RECORDING_CONFIG.max_retry_times";
    public static final String CONFIG_RETRY_INTERVAL = "RECORDING_CONFIG.retry_interval_seconds";

    // ==================== 定时任务配置 ====================
    
    /**
     * 定时任务相关
     */
    public static final String RECORDING_SCHEDULER_CRON = "0 * * * * ?"; // 每分钟执行一次
    public static final String RECORDING_SCHEDULER_ZONE = "Asia/Shanghai";

    // ==================== 录制业务常量 ====================
    
    /**
     * 录制操作类型
     */
    public static final String OPERATION_START = "START";
    public static final String OPERATION_STOP = "STOP";

    /**
     * 录制结果状态
     */
    public static final String RESULT_SUCCESS = "SUCCESS";
    public static final String RESULT_FAILED = "FAILED";
    public static final String RESULT_SKIPPED = "SKIPPED";

    /**
     * 录制质量选项
     */
    public static final String QUALITY_HIGH = "HIGH";
    public static final String QUALITY_NORMAL = "NORMAL";
    public static final String QUALITY_LOW = "LOW";

    /**
     * 开关状态
     */
    public static final String ENABLED = "1";
    public static final String DISABLED = "0";

    /**
     * 策略状态常量
     */
    public static final Integer STRATEGY_STATUS_DISABLED = 0;
    public static final Integer STRATEGY_STATUS_ENABLED = 1;
    
    /**
     * 全局策略标识常量
     */
    public static final Integer GLOBAL_STRATEGY_NO = 0;
    public static final Integer GLOBAL_STRATEGY_YES = 1;

    /**
     * 关系状态常量
     */
    public static final Integer RELATION_STATUS_DISABLED = 0;
    public static final Integer RELATION_STATUS_ENABLED = 1;
    
    /**
     * 删除状态常量
     */
    public static final Integer NOT_DELETED = 0;
    public static final Integer DELETED = 1;


    // ==================== 默认配置值 ====================
    
    /**
     * 系统默认配置值
     */
    public static final String DEFAULT_RECORD_DURATION = "60";
    public static final String DEFAULT_MAX_FILE_SIZE = "2";
    public static final String DEFAULT_QUALITY = QUALITY_NORMAL;
    public static final String DEFAULT_AUTO_DELETE_DAYS = "30";
    public static final String DEFAULT_THRESHOLD_PERCENT = "80";
    public static final String DEFAULT_PATH_ROOT = "/data/videos";
    public static final String DEFAULT_SYSTEM_VERSION = "1.0.0";
    public static final String DEFAULT_MAX_CONCURRENT_STREAMS = "50";

    /**
     * 录制业务默认配置值
     */
    public static final String DEFAULT_ENABLED = "1";
    public static final String DEFAULT_MAX_RETRY_TIMES = "3";
    public static final String DEFAULT_RETRY_INTERVAL = "30";

    // ==================== 文件路径 ====================
    
    /**
     * 录制文件路径模板
     */
    public static final String RECORDING_FILE_PATH_TEMPLATE = "/data/recordings/{cameraId}/{date}/{filename}";

    // ==================== 配置来源说明 ====================
    
    /**
     * 配置来源说明
     */
    public static final String CONFIG_SOURCE_CAMERA = "摄像头个人策略";
    public static final String CONFIG_SOURCE_GLOBAL = "全局默认策略";
    public static final String CONFIG_SOURCE_NONE = "无可用策略";
}